{% include "base/template_head.html" %}
{% load static %}

<link rel="stylesheet" href="/static/css/paging.css">
<script type="text/javascript" src="/static/js/jquery.js"></script>
<script type="text/javascript" src="/static/js/query.js"></script>
<script type="text/javascript" src="/static/js/paging.js"></script>
<!-- 百分百画图 -->
<script src="{% static 'js/jquery.easypiechart.js' %}"></script>

</script>
<div class="row">
    <div class="col-lg-12">
        <div class="row">
            <div class="col-lg-12">
                <div class="page-header">
                    <h1>测试管理</h1>
                </div>
                <!-- <h2 class="header"><b>测试管理</b></h2> -->
                <ul class="list-unstyled spaced">
                    <div class="tabbable">
                        <ul class="nav nav-tabs" id="myTab">
                            <li class="active">
                                <a data-toggle="tab" href="#mytest" >
                                    <i class="blue ace-icon fa fa-stethoscope bigger-120" onclick="GetTestOverView()"></i>
                                    发布测试预览
                                </a>
                            </li>
                            <li >
                                <a data-toggle="tab" href="#fortest" onclick="GetTestSerachList(1,10,'')">
                                    <i class="orange ace-icon fa fa-check-square-o bigger-120"></i>
                                    待测试验证 &nbsp;<span class="badge badge-danger" id='pretestcount'></span>
                                </a>            
                            </li>
                            <li class="dropdown">
                                <a data-toggle="dropdown" class="dropdown-toggle" href="#">
                                <i class="purple ace-icon fa fa-th-list bigger-120"></i>
                                    测试完成 &nbsp;
                                    <i class="ace-icon fa fa-caret-down bigger-110 width-auto"></i>
                                </a>

                                <ul class="dropdown-menu dropdown-info dropdown-100">
                                    <li>
                                        <a data-toggle="tab" href="#dropdown1" onclick="GetAcceptSearchTestList(1,1,10,'')"><i class="green ace-icon fa fa-check bigger-120"></i>&nbsp;&nbsp;测试已通过&nbsp;</a>
                                    </li>

                                    <li>
                                        <a data-toggle="tab" href="#dropdown2" onclick="GetAcceptSearchTestList(2,1,10,'')"><i class="red ace-icon fa fa-close bigger-120"></i>&nbsp;&nbsp;测试不通过&nbsp;</a>
                                    </li>
                                </ul>
                            </li>
                        </ul>

                        <div class="tab-content" >
                            <div id="mytest" class="tab-pane fade in active" style="width: 98%;margin:auto;">
                                <!-- <div class="space-2"></div>  -->
                                
                                        <div class="infobox infobox-blue infobox-dark" style="width: 14%;height: 50px">
                                            <div class="infobox-icon" >
                                                <i class="ace-icon fa fa-area-chart fa-4x"></i>
                                            </div>
                                            <div class="infobox-data">
                                                <div class="infobox-content">申请发布项目总数</div>
                                                <div class="infobox-content">{{ ForReview_total }}&nbsp;条</div>
                                            </div>
                                        </div>

                                        <div class="infobox infobox-brown infobox-dark" style="width: 14%;height: 50px">
                                            <div class="infobox-icon" >
                                                <i class="ace-icon fa fa-calendar-check-o fa-4x"></i>
                                            </div>
                                            <div class="infobox-data">
                                                <div class="infobox-content">审核通过/发布成功总数</div>
                                                <div class="infobox-content">{{ PublishSuccess_total }}&nbsp;条</div>
                                            </div>
                                        </div>
                                        <div class="infobox infobox-pink infobox-dark" style="width: 14%;height: 50px">
                                            <div class="infobox-progress">
                                                <!-- #section:pages/dashboard.infobox.easypiechart -->
                                                <div class="easy-pie-chart percentage" data-percent="{{ PublishSuccess_percent }}" data-size="39">
                                                    <span class="percent">{{ PublishSuccess_percent }}</span>%
                                                </div>
                                            </div>

                                            <div class="infobox-data">
                                                <div class="infobox-content">审批通过/成功发布比率</div>
                                                <div class="infobox-content">{{ PublishSuccess_percent }}&nbsp;%</div>
                                            </div>
                                        </div>


                                        <div class="infobox infobox-orange infobox-dark" style="width: 14%;height: 50px">
                                            <div class="infobox-icon">
                                                <i class="ace-icon fa fa-list-ol fa-4x"></i>
                                            </div>

                                            <div class="infobox-data">
                                                <div class="infobox-content">待测试项目总数</div>
                                                <div class="infobox-content">{{ ForTest_total }}&nbsp;条</div>
                                            </div>
                                        </div>
                                        <div class="infobox infobox-purple infobox-dark" style="width: 14%;height: 50px">
                                            <div class="infobox-icon">
                                                <i class="ace-icon fa fa-check-circle fa-4x"></i>
                                            </div>

                                            <div class="infobox-data" style="margin: 0 auto;" >
                                                <div class="infobox-content">已测试通过总数</div>
                                                <div class="infobox-content">{{ ForTest_success }}&nbsp;条</div>
                                            </div>
                                        </div>
                                        <div class="infobox infobox-red infobox-dark" style="width: 14%;height: 50px">
                                            <div class="infobox-icon">
                                                <i class="ace-icon fa fa-times-circle fa-4x"></i>
                                            </div>

                                            <div class="infobox-data">
                                                <div class="infobox-content">已测试不通过总数</div>
                                                <div class="infobox-content">{{ ForTest_fail }}&nbsp;条</div>
                                            </div>
                                        </div>
                                        <div class="infobox infobox-green infobox-dark" style="width: 14%;height: 50px">
                                            <div class="infobox-progress">
                                                <!-- #section:pages/dashboard.infobox.easypiechart -->
                                                <div class="easy-pie-chart percentage" data-percent="{{ TestSuccess_percent }}" data-size="39">
                                                    <span class="percent">{{ TestSuccess_percent }}</span>%
                                                </div>
                                            </div>

                                            <div class="infobox-data">
                                                <div class="infobox-content">测试通过比率</div>
                                                <div class="infobox-content">{{ TestSuccess_percent }}&nbsp;%</div>
                                            </div>
                                        </div>




<!--                                     <span class="btn btn-app btn-sm btn-primary no-hover" style="width: 10%">
                                        <span class="line-height-1 bigger-170 "><i class="fa fa-area-chart"></i> &nbsp;&nbsp;{{ ForReview_total }} </span>
                                        <br />
                                        <span class="line-height-1 smaller-90 "> 总发布项目 </span>
                                    </span>
                                    <span class="btn btn-app btn-sm btn-yellow no-hover" style="width: 10%" onclick="GoToForTest()">
                                        <span class="line-height-1 bigger-170"><i class="fa fa-list-ol" ></i>&nbsp;&nbsp;{{ ForTest_total }}</span>
                                        <br />
                                        <span class="line-height-1 smaller-90"> 待测试项目 </span>
                                    </span>
                                    <span class="btn btn-app btn-sm btn-success no-hover" style="width: 10%">
                                        <span class="line-height-1 bigger-170"><i class="fa fa-check-circle"></i>&nbsp;&nbsp; {{ ForTest_success }} </span>
                                        <br />
                                        <span class="line-height-1 smaller-90"> 测试通过 </span>
                                    </span>
                                    <span class="btn btn-app btn-sm btn-danger no-hover" style="width: 10%">
                                        <span class="line-height-1 bigger-170"><i class="fa fa-times-circle"></i>&nbsp;&nbsp; {{ ForTest_fail }} </span>
                                        <br />
                                        <span class="line-height-1 smaller-90"> 测试不通过 </span>
                                    </span>
                                    <span style="width: 19%">
                                    <div class="grid3 center">

                                        <div class="easy-pie-chart percentage" data-percent="67" data-color="#59A84B">
                                            <span class="percent">67</span>%
                                            <br>
                                            <span class="line-height-1 smaller-90"> 测试通过比 </span>
                                        </div>
                                        </div>
                                   
                                    </span> -->


                                
                                <div class="space-12"></div> 
                                <div class="row">
                                    
                                
                                    <div class="widget-box transparent col-md-6 col-sm-6">
                                        <div class="widget-header widget-header-small">
                                            <h4 class="widget-title blue smaller" style="font-family: Microsoft YaHei">
                                                <i class="ace-icon fa fa-rss orange"></i>
                                                最近10条发布申请
                                            </h4>

                                            <div class="widget-toolbar action-buttons">
                                                <a href="#" data-action="reload" onclick="GetLastTenPublishInfo();">
                                                    <i class="ace-icon fa fa-refresh blue"></i>
                                                </a>&nbsp;
                                                <a href="#" class="pink">
                                                    <i class="ace-icon fa fa-forward"></i>
                                                </a>
                                            </div>
                                        </div>

                                        <div class="widget-body">
                                            <div class="widget-main padding-8">
                                                <!-- #section:pages/profile.feed -->
                                                <div id="TenPublish" class="profile-feed">
                                                    数据正在加载...    
                                                </div>

                                                <!-- /section:pages/profile.feed -->
                                            </div>
                                        </div>
                                    </div>

                                    <div class="widget-box transparent col-md-6 col-sm-6">
                                        <div class="widget-header widget-header-small">
                                            <h4 class="widget-title blue smaller" style="font-family: Microsoft YaHei">
                                                <i class="ace-icon fa fa-list-ul orange"></i>
                                                最近10条审核项目
                                            </h4>

                                            <div class="widget-toolbar action-buttons">
                                                <a href="#" data-action="reload" onclick="GetLastTenTestInfo();">
                                                    <i class="ace-icon fa fa-refresh blue"></i>
                                                </a>&nbsp;
                                                <a href="#" class="pink">
                                                    <i class="ace-icon fa fa-forward"></i>
                                                </a>
                                            </div>
                                        </div>

                                        <div class="widget-body">
                                            <div class="widget-main padding-8">
                                                <!-- #section:pages/profile.feed -->
                                                <div id="TenTestInfo" class="profile-feed">
                                                    数据正在加载...  
                                                </div>

                                                <!-- /section:pages/profile.feed -->
                                            </div>
                                        </div>
                                    </div>

<!--                                     <div class="widget-box transparent col-md-4 col-sm-4">
                                        <div class="widget-header widget-header-small">
                                            <h4 class="widget-title blue smaller" style="font-family: Microsoft YaHei">
                                                <i class="ace-icon fa fa-list-ul orange"></i>
                                                最近10条测试项目
                                            </h4>

                                            <div class="widget-toolbar action-buttons">
                                                <a href="#" data-action="reload" onclick="GetLastTenTestInfo();">
                                                    <i class="ace-icon fa fa-refresh blue"></i>
                                                </a>&nbsp;
                                                <a href="#" class="pink">
                                                    <i class="ace-icon fa fa-forward"></i>
                                                </a>
                                            </div>
                                        </div>

                                        <div class="widget-body">
                                            <div class="widget-main padding-8">
                                                <div id="TenTestInfo" class="profile-feed">
                                                    数据正在加载...  
                                                </div>
                                            </div>
                                        </div>
                                    </div> -->

                                </div>
                                                       
                            </div>

                            <div id="fortest" class="tab-pane fade">
                                <span style="float: left;color: orange"><b>&nbsp;查询记录数&nbsp;<span id='searchcount'></span>&nbsp;条</b></span>
                                <div class="nav-search" style="float: right;">
                                    <span class="input-icon">
                                    <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input00" autocomplete="off" />
                                    <i class="ace-icon fa fa-search nav-search-icon"></i>
                                    </span>
                                </div>
                                <br>
                                <hr>
                                <div class="widget-body">
                                    <div class="widget-main no-padding">
                                        <table class="table table-bordered table-striped">
                                            <thead class="thin-border-bottom">
                                                <tr>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布ID</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>部署类型</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布者</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>模块名</th>
                                                    <!-- <th><i class="ace-icon fa fa-caret-right blue"></i>压缩文件包</th> -->
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布状态</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发起时间</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布主机</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>审批备注</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>审批/发布时间</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>测试</th>
                                                </tr>
                                            </thead>

                                            <tbody id= 'pretest'>
                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                                <br>
                                <hr>                                
                                <!-- <div id="pageToolbar"></div> -->
                            </div>

                            <div id="dropdown1" class="tab-pane fade">
                                <!-- <span style="float: left;color: green"><b><i class="ace-icon fa fa-bolt"></i>&nbsp;列出所有测试完成并通过测试的项目</b></span> -->
                                <span style="float: left;color: green"><b>&nbsp;查询记录数&nbsp;<span id='successcount'></span>&nbsp;条</b></span>
                                <div class="nav-search" style="float: right;">
                                    <span class="input-icon">
                                    <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input01" autocomplete="off" />
                                    <i class="ace-icon fa fa-search nav-search-icon"></i>
                                    </span>
                                </div>
                                <br>
                                <hr>
                                <div class="widget-body">
                                    <div class="widget-main no-padding">
                                        <table class="table table-bordered table-striped">
                                            <thead class="thin-border-bottom">
                                                <tr>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布ID</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>部署类型</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布者</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>模块名</th>
                                                    <!-- <th><i class="ace-icon fa fa-caret-right blue"></i>压缩文件包</th> -->
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布状态</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发起时间</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布主机</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>审核者</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>审核/发布时间</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>审核意见</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>测试人员</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>测试结束时间</th>
                                                </tr>
                                            </thead>

                                            <tbody id= 'reviewed_1'>
                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                                <br>
                                <hr>                                
                                <!-- <div id="pageToolbar"></div> -->
                            </div>

                            <div id="dropdown2" class="tab-pane fade">
                                <!-- <span style="float: left;color: red"><b><i class="ace-icon fa fa-bolt"></i>&nbsp;列出所有测试完成并没有通过测试的项目</b></span> -->
                                <span style="float: left;color: red"><b>&nbsp;查询记录数&nbsp;<span id='failedcount'></span>&nbsp;条</b></span>
                                <div class="nav-search" style="float: right;">
                                    <span class="input-icon">
                                    <input type="text" placeholder="Search ..." class="nav-search-input" id="nav-search-input02" autocomplete="off" />
                                    <i class="ace-icon fa fa-search nav-search-icon"></i>
                                    </span>
                                </div>
                                <br>
                                <hr>
                                <div class="widget-body">
                                    <div class="widget-main no-padding">
                                        <table class="table table-bordered table-striped">
                                            <thead class="thin-border-bottom">
                                                <tr>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布ID</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>部署类型</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布者</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>模块名</th>
                                                    <!-- <th><i class="ace-icon fa fa-caret-right blue"></i>压缩文件包</th> -->
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布状态</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发起时间</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>发布主机</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>审核者</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>审核/发布时间</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>审核意见</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>测试人员</th>
                                                    <th><i class="ace-icon fa fa-caret-right blue"></i>测试结束时间</th>
                                                </tr>
                                            </thead>

                                            <tbody id= 'reviewed_2'>
                                            </tbody>
                                        </table>

                                    </div>
                                </div>
                                <br>
                                <hr>                                
                                <!-- <div id="pageToolbar"></div> -->
                            </div>

                            <div id="pageToolbar"></div>
                        </div>

                    </div>



                </ul>
            </div>
        </div>
    </div>
    <div class="col-lg-7 col-lg-offset-1">

        <div class="row">
            <div class="col-lg-12">
            </div>
        </div>

        <div class="row">
            <div class="col-lg-12">
            </div>
        </div>
    </div>





</div>
{% include "base/template_footer.html" %}
<script>
    $('.easy-pie-chart.percentage').each(function(){
        var barColor = $(this).data('color') || '#555';
        var trackColor = '#E2E2E2';
        var size = parseInt($(this).data('size')) || 72;
        $(this).easyPieChart({
            barColor: barColor,
            trackColor: trackColor,
            scaleColor: false,
            lineCap: 'butt',
            lineWidth: parseInt(size/10),
            animate:false,
            size: size
        }).css('color', barColor);
    });



    function GetTestOverView(){
        GetLastTenPublishInfo();
        GetLastTenTestInfo();
    }

    function GoToForTest(){

    };


    function GetLastTenPublishInfo(){
        // 加载最近10项发布数据供测试首页展示
        $.ajax({
            type:'POST',
            url:'/softwaretest/GetLastTenPublishInfo/',
            dataType:'json',
            success:function(val){
                // console.log(val)
                // console.log(val.TenPublishInfo.length)
                // console.log(val.TenPublishInfo[0]['publish_user'])
                $("#TenPublish").html("")
                for(var i=0;i<val.TenPublishInfo.length;i++){
                    $("#TenPublish").append('<div class="profile-activity clearfix">\
                                            <div>\
                                                <i class="pull-left thumbicon fa fa-paper-plane btn-info no-hover"></i>\
                                                <a class="user" href="#"> '+(val.TenPublishInfo[i]["publish_user"])+' </a>\
                                                发起了一次对<b class="orange">'+(val.TenPublishInfo[i]["publish_module"])+'</b>模块的发布申请\
                                                <div style="width:30%;float: right;" data-percent="30%" class="inline middle no-margin progress progress-striped active">\
                                                    <div class="progress-bar progress-bar-success" style="width:30%">\
                                                        <span class="pull-right">30%</span>\
                                                    </div>\
                                              </div>\
                                              <div class="time">\
                                                    <i class="ace-icon fa fa-clock-o bigger-110"></i>\
                                                    '+(val.TenPublishInfo[i]["create_time"])+'\
                                                </div>\
                                            </div>\
                                            <div class="tools action-buttons">\
                                                <a href="/review/review_handle/'+(val.TenPublishInfo[i]["id"])+'/"><button href="#" class="btn btn-minier btn-primary blue">\
                                                    <i class="ace-icon fa fa-pencil bigger-125">&nbsp;<span style="font-size: 10px;font-family: Microsoft YaHei">查看</span></i>\
                                                </button></a>\
                                            </div>\
                                        </div>')
                }
                
            },error:function(){
                console.log('error1111')
            }
        })

    };

    function GetLastTenTestInfo(){
        // 加载最近10项测试项目供测试首页展示
        $.ajax({
            type:'POST',
            url:'/softwaretest/GetLastTenTestInfo/',
            dataType:'json',
            success:function(val){
                // console.log(val)
                $("#TenTestInfo").html("")
                for(var i=0;i<val.TenTestInfo.length;i++){
                    if(val.TenTestInfo[i]["publish_status"] == '审核通过,已发布'){
                        $("#TenTestInfo").append('<div class="profile-activity clearfix">\
                            <div>\
                                <i class="pull-left thumbicon fa fa-check btn-success no-hover"></i>\
                                <a class="user" href="#"> '+(val.TenTestInfo[i]["review_owner"])+' </a>\
                                同意并发布了一个<b class="orange">'+(val.TenTestInfo[i]["publish_module"])+'</b>模块的发布申请\
                                <div style="width:30%;float: right;" data-percent="66%" class="inline middle no-margin progress progress-striped active">\
                                    <div class="progress-bar progress-bar-success" style="width:66%">\
                                        <span class="pull-right">66%</span>\
                                    </div>\
                              </div>\
                              <div class="time">\
                                    <i class="ace-icon fa fa-clock-o bigger-110"></i>\
                                    '+(val.TenTestInfo[i]["review_time"])+'\
                                </div>\
                            </div>\
                            <div class="tools action-buttons">\
                                <a href="/review/publish_report/'+(val.TenTestInfo[i]["publish_id"])+'/"><button href="#" class="btn btn-minier btn-primary blue">\
                                    <i class="ace-icon fa fa-pencil bigger-125">&nbsp;<span style="font-size: 10px;font-family: Microsoft YaHei">查看</span></i>\
                                </button></a>\
                                <!-- <a href="#" class="red">\
                                    <i class="ace-icon fa fa-times bigger-125"></i>\
                                </a> -->\
                            </div>\
                        </div>')
                    }else{
                        $("#TenTestInfo").append('<div class="profile-activity clearfix">\
                            <div>\
                                <i class="pull-left thumbicon fa fa-times btn-danger no-hover"></i>\
                                <a class="user" href="#"> '+(val.TenTestInfo[i]["review_owner"])+' </a>\
                                拒绝了一个<b class="orange">'+(val.TenTestInfo[i]["publish_module"])+'</b>模块的发布申请\
                                <div style="width:30%;float: right;" data-percent="100%" class="inline middle no-margin progress progress-striped active">\
                                    <div class="progress-bar progress-bar-danger" style="width:100%">\
                                        <span class="pull-right">100%</span>\
                                    </div>\
                              </div>\
                              <div class="time">\
                                    <i class="ace-icon fa fa-clock-o bigger-110"></i>\
                                    '+(val.TenTestInfo[i]["review_time"])+'\
                                </div>\
                            </div>\
                            <div class="tools action-buttons">\
                                <a href="/review/publish_report/'+(val.TenTestInfo[i]["publish_id"])+'/"><button href="#" class="btn btn-minier btn-primary blue">\
                                    <i class="ace-icon fa fa-pencil bigger-125">&nbsp;<span style="font-size: 10px;font-family: Microsoft YaHei">查看</span></i>\
                                </button></a>\
                                <!-- <a href="#" class="red">\
                                    <i class="ace-icon fa fa-times bigger-125"></i>\
                                </a> -->\
                            </div>\
                        </div>')                        
                    }

                }

            },error:function(){
                console.log('error1111')
            }
        })

    };



    $(document).ready(function(){
        // GetLastTestInfo();
        GetLastTenPublishInfo();
        GetLastTenTestInfo();
      //   $("#nav-search-input").keydown(function(e) {  
      //     if (e.keyCode == 13) {
      //       if($("#nav-search-input").val() != "")
      //           layer.alert($("#nav-search-input").val())
      //     }
      // });
    });

    /*
    //获取待测试列表
    function GetTestList(s_page,page_size) {
        //取出单页待数据组成列表
        function GetTestListInfo(s_page,page_size){
            $.ajax({
                type:'POST',
                url:'/softwaretest/SoftwareTestList/',
                data:{'s_page':s_page,'page_size':page_size},
                dataType:'json',
                success:function(val){
                    // console.log(val)
                    var detail = val.TestQsetList
                    // console.log(detail[0])
                    // $("#previewlist").html("")
                    // $('#previewlistcount').html(detail.length)
                    if(detail.length==0){
                        $("#pretest").html('<tr><td colspan="9" style="text-align:center;">当前无记录</td></tr>')
                    }else{
                        $("#pretest").html("")
                    }
                    for (var i=0;i < detail.length;i++){
                        // $("#per_publish_user").html(val.review_data[i].publish_user)
                        // console.log(val.review_data[i].publish_user)
                        var test_id = detail[i]['publish_id']
                    
                    $("#pretest").append("<tr>\
                            <td id='test_"+(test_id)+"_id'></td>\
                            <td id='test_"+(test_id)+"_type'></td>\
                            <td id='test_"+(test_id)+"_user'></td>\
                            <td id='test_"+(test_id)+"_module'></td>\
                            <td id='test_"+(test_id)+"_status'></td>\
                            <td id='test_"+(test_id)+"_createtime'></td>\
                            <td id='test_"+(test_id)+"_serverlist'></td>\
                            <td id='test_"+(test_id)+"_review_info'></td>\
                            <td id='test_"+(test_id)+"_review_time'></td>\
                            <td id='test_"+(test_id)+"_action'></td></tr>")

                    //加载数据

                    $("#test_"+(test_id)+"_id").html('<a href="/softwaretest/TestHandle/'+(test_id)+'/"><span class="badge">'+test_id+'</span></a>')
                    $("#test_"+(test_id)+"_type").html(detail[i].publish_type)
                    $("#test_"+(test_id)+"_user").html(detail[i].publish_user)
                    $("#test_"+(test_id)+"_module").html(detail[i].publish_module)
                    $("#test_"+(test_id)+"_filename").html(detail[i].publish_filename)
                    $("#test_"+(test_id)+"_status").html('<span class="badge badge-warning">'+detail[i].publish_status+'</span>')
                    $("#test_"+(test_id)+"_createtime").html(detail[i].create_time)
                    $("#test_"+(test_id)+"_serverlist").html(detail[i].publish_serverlist)
                    $("#test_"+(test_id)+"_review_info").html(detail[i].review_info+"..."+"<a href='/softwaretest/TestHandle/"+(test_id)+"/'><span class='badge badge-info'>查看详情</span></a>")
                    $("#test_"+(test_id)+"_review_time").html(detail[i].review_time)
                    $("#test_"+(test_id)+"_action").html('<a href="/softwaretest/TestHandle/'+(test_id)+'/"><div class="btn btn-primary btn-mini">测试</div></a>')
                    }
                    // $('#pageToolbar').html("");
                    // $('#pageToolbar').Paging({pagesize:10,count:detail.length,callback:function(page,size,count){alert('1')}});

                },error:function(){
                    console.log('error')
                }
            })          
        };

        //取出总页数
        $.ajax({
            type:'POST',
            url:'/softwaretest/SoftwareTestPageCount/',
            dataType:'text',
            success:function(val){
                $("#pretestcount").html('总记录数：'+val);
                $("#searchcount").html(val);
                GetTestListInfo(s_page,page_size);
                //加载页码
                $('#pageToolbar').html("");
                $('#pageToolbar').Paging({pagesize:10,count:val,callback:function(page,size,count){
                    //page:当前选择页码
                    //size:当前每页显示数量
                    //count：当前页码总数(含有多少个size)
                    GetTestListInfo(page,10)
                    }
                });
            },error:function(){
                console.log('error')
            }
        });     


    };
    */

    $("#nav-search-input00").keydown(function(e) {  
          if (e.keyCode == 13) {
            // if($("#nav-search-input").val() != ""){
                var k_words = $("#nav-search-input00").val()
                // layer.alert($("#nav-search-input01").val())
                GetTestSerachList(1,10,k_words)
            // }

          }
      });

    //查询待测试列表
    function GetTestSerachList(s_page,page_size,k_words) {
        //取出单页待数据组成列表
        function GetTestListSerachInfo(s_page,page_size){
            var k_words = $("#nav-search-input00").val()
            $.ajax({
                type:'POST',
                url:'/softwaretest/SoftwareTestSearchList/',
                data:{'s_page':s_page,'page_size':page_size,'k_words':k_words},
                dataType:'json',
                success:function(val){
                    // console.log(val)
                    var detail = val.SoftwareTest_obj
                    // console.log(detail[0])
                    // $("#previewlist").html("")
                    // $('#previewlistcount').html(detail.length)
                    if(detail.length==0){
                        $("#pretest").html('<tr><td colspan="9" style="text-align:center;">当前无记录</td></tr>')
                    }else{
                        $("#pretest").html("")
                    }
                    for (var i=0;i < detail.length;i++){
                        // $("#per_publish_user").html(val.review_data[i].publish_user)
                        // console.log(val.review_data[i].publish_user)
                        var test_id = detail[i]['publish_id']
                    
                    $("#pretest").append("<tr>\
                            <td id='test_"+(test_id)+"_id'></td>\
                            <td id='test_"+(test_id)+"_type'></td>\
                            <td id='test_"+(test_id)+"_user'></td>\
                            <td id='test_"+(test_id)+"_module'></td>\
                            <td id='test_"+(test_id)+"_status'></td>\
                            <td id='test_"+(test_id)+"_createtime'></td>\
                            <td id='test_"+(test_id)+"_serverlist'></td>\
                            <td id='test_"+(test_id)+"_review_info'></td>\
                            <td id='test_"+(test_id)+"_review_time'></td>\
                            <td id='test_"+(test_id)+"_action'></td></tr>")

                    //加载数据

                    $("#test_"+(test_id)+"_id").html('<a href="/softwaretest/TestHandle/'+(test_id)+'/"><span class="badge">'+test_id+'</span></a>')
                    $("#test_"+(test_id)+"_type").html(detail[i].publish_type)
                    $("#test_"+(test_id)+"_user").html(detail[i].publish_user)
                    $("#test_"+(test_id)+"_module").html(detail[i].publish_module)
                    $("#test_"+(test_id)+"_filename").html(detail[i].publish_filename)
                    $("#test_"+(test_id)+"_status").html('<span class="badge badge-warning">'+detail[i].publish_status+'</span>')
                    $("#test_"+(test_id)+"_createtime").html(detail[i].create_time)
                    $("#test_"+(test_id)+"_serverlist").html(detail[i].publish_serverlist)
                    $("#test_"+(test_id)+"_review_info").html(detail[i].review_info+"..."+"<a href='/softwaretest/TestHandle/"+(test_id)+"/'><span class='badge badge-info'>查看详情</span></a>")
                    $("#test_"+(test_id)+"_review_time").html(detail[i].review_time)
                    $("#test_"+(test_id)+"_action").html('<a href="/softwaretest/TestHandle/'+(test_id)+'/"><div class="btn btn-primary btn-mini">测试</div></a>')
                    }
                    // $('#pageToolbar').html("");
                    // $('#pageToolbar').Paging({pagesize:10,count:detail.length,callback:function(page,size,count){alert('1')}});

                },error:function(){
                    console.log('error')
                }
            })          
        };

        //取出总页数
        $.ajax({
            type:'POST',
            url:'/softwaretest/SoftwareTestPageSearchCount/',
            data:{'k_words':k_words},
            dataType:'text',
            success:function(val){
                $("#searchcount").html(val);
                GetTestListSerachInfo(s_page,page_size,k_words);
                //加载页码
                $('#pageToolbar').html("");
                $('#pageToolbar').Paging({pagesize:10,count:val,callback:function(page,size,count){
                    //page:当前选择页码
                    //size:当前每页显示数量
                    //count：当前页码总数(含有多少个size)
                    GetTestListSerachInfo(page,10)
                    }
                });
            },error:function(){
                console.log('error')
            }
        });     


    };




    //获取测试完成后列表
    function GetAcceptTestList(args,s_page,page_size){
        //取出单页测试完成数据
        function GetAcceptTestInfo(args,s_page,page_size){
            $.ajax({
                type:'POST',
                url:'/softwaretest/GetActionList/',
                data:{'args':args,'s_page':s_page,'page_size':page_size},
                dataType:'json',
                success:function(val){
                    // console.log(val)
                    // console.log(args)
                    var detail = val.TestActionData
                    // $('#reviewaccept').html(detail.length)
                    if(detail.length==0){
                        $("#reviewed_"+(args)).html('<tr><td colspan="10" style="text-align:center;">当前无记录</td></tr>')
                    }else{
                        $("#reviewed_"+(args)).html("")
                    }
                    // $("#reviewed_"+(args)).html("")
                    for (var i=0;i < detail.length;i++){
                        // $("#per_publish_user").html(val.review_data[i].publish_user)
                        // console.log(val.review_data[i].publish_user)
                        var test_id = detail[i]['publish_id']

                            $("#reviewed_"+(args)).append("<tr>\
                            <td id='reviewed_"+(args)+(test_id)+"_id'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_type'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_user'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_module'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_status'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_createtime'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_serverlist'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_review_owner'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_review_time'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_review_info'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_test_user'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_test_time'></td></tr>")

                            //加载数据

                            $("#reviewed_"+(args)+(test_id)+"_id").html('<a href="/softwaretest/TestReport/'+(test_id)+'/"><span class="badge">'+test_id+'</span></a>')
                            $("#reviewed_"+(args)+(test_id)+"_type").html(detail[i].publish_type)
                            $("#reviewed_"+(args)+(test_id)+"_user").html(detail[i].publish_user)
                            $("#reviewed_"+(args)+(test_id)+"_module").html(detail[i].publish_module)
                            $("#reviewed_"+(args)+(test_id)+"_filename").html(detail[i].publish_filename)
                            if(args == 1){
                                $("#reviewed_"+(args)+(test_id)+"_status").html('<span class="badge badge-success">'+detail[i].publish_status+'</span>')
                            }else{
                                $("#reviewed_"+(args)+(test_id)+"_status").html('<span class="badge badge-danger">'+detail[i].publish_status+'</span>')
                            }
                            
                            $("#reviewed_"+(args)+(test_id)+"_createtime").html(detail[i].create_time)
                            $("#reviewed_"+(args)+(test_id)+"_serverlist").html(detail[i].publish_serverlist)
                            $("#reviewed_"+(args)+(test_id)+"_review_owner").html(detail[i].review_owner)
                            $("#reviewed_"+(args)+(test_id)+"_review_time").html(detail[i].review_time)
                            $("#reviewed_"+(args)+(test_id)+"_review_info").html(detail[i].review_info.substring(0,10)+"..."+"<a href='/softwaretest/TestReport/"+(test_id)+"/'><span class='badge badge-info'>查看详情</span></a>")
                            $("#reviewed_"+(args)+(test_id)+"_test_user").html(detail[i].test_user)
                            $("#reviewed_"+(args)+(test_id)+"_test_time").html(detail[i].test_endtime)
                    
                    }
                    // console.log(detail.length)
                    return detail.length;
                    // console.log(detail.length)

                    // $('#pageToolbar').html("");
                    // $('#pageToolbar').Paging({pagesize:10,count:val.page_total,callback:function(page,size,count){
                    //  //page:当前选择页码
                    //  //size:当前每页显示数量
                    //  //count：当前页码总数(含有多少个size)
                    //  console.log('当前页是第'+page+'页')
                    //  }
                    // });
                },error:function(){
                    console.log('error')
                }
            });
        };


        //取出总页数
        $.ajax({
            type:'POST',
            url:'/softwaretest/GetActionListPageCount/',
            data:{'args':args},
            dataType:'text',
            success:function(val){
                // args:
                // 1-success
                // 2-failed
                if(args == '1'){
                    $("#successcount").html(val)
                }else{
                    $("#failedcount").html(val)
                }
                GetAcceptTestInfo(args,s_page,page_size);
                //加载页码
                $('#pageToolbar').html("");
                $('#pageToolbar').Paging({pagesize:10,count:val,callback:function(page,size,count){
                    //page:当前选择页码
                    //size:当前每页显示数量
                    //count：当前页码总数(含有多少个size)
                    GetAcceptTestInfo(args,page,10)
                    }
                });
            },error:function(){
                console.log('error')
            }
        });

    };
    $("#nav-search-input01").keydown(function(e) {  
        if (e.keyCode == 13) {
            // if($("#nav-search-input").val() != ""){
                var k_words = $("#nav-search-input01").val()
                // layer.alert($("#nav-search-input01").val())
                GetAcceptSearchTestList(1,1,10,k_words)
            // }

          }
      });

    $("#nav-search-input02").keydown(function(e) {  
        if (e.keyCode == 13) {
            // if($("#nav-search-input").val() != ""){
                var k_words = $("#nav-search-input02").val()
                // layer.alert($("#nav-search-input02").val())
                GetAcceptSearchTestList(2,1,10,k_words)
            // }

          }
      });

    //查询测试完成后列表
    function GetAcceptSearchTestList(args,s_page,page_size,k_words){
        //取出单页测试完成数据
        function GetAcceptSearchTestInfo(args,s_page,page_size){
            var k_words = $("#nav-search-input0"+args).val()
            $.ajax({
                type:'POST',
                url:'/softwaretest/GetActionSearchList/',
                data:{'args':args,'s_page':s_page,'page_size':page_size,'k_words':k_words},
                dataType:'json',
                success:function(val){
                    // console.log(val)
                    // console.log(args)
                    var detail = val.GetActionData
                    // $('#reviewaccept').html(detail.length)
                    if(detail.length==0){
                        $("#reviewed_"+(args)).html('<tr><td colspan="10" style="text-align:center;">当前无记录</td></tr>')
                    }else{
                        $("#reviewed_"+(args)).html("")
                    }
                    // $("#reviewed_"+(args)).html("")
                    for (var i=0;i < detail.length;i++){
                        // $("#per_publish_user").html(val.review_data[i].publish_user)
                        // console.log(val.review_data[i].publish_user)
                        var test_id = detail[i]['publish_id']

                            $("#reviewed_"+(args)).append("<tr>\
                            <td id='reviewed_"+(args)+(test_id)+"_id'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_type'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_user'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_module'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_status'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_createtime'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_serverlist'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_review_owner'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_review_time'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_review_info'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_test_user'></td>\
                            <td id='reviewed_"+(args)+(test_id)+"_test_time'></td></tr>")

                            //加载数据

                            $("#reviewed_"+(args)+(test_id)+"_id").html('<a href="/softwaretest/TestReport/'+(test_id)+'/"><span class="badge">'+test_id+'</span></a>')
                            $("#reviewed_"+(args)+(test_id)+"_type").html(detail[i].publish_type)
                            $("#reviewed_"+(args)+(test_id)+"_user").html(detail[i].publish_user)
                            $("#reviewed_"+(args)+(test_id)+"_module").html(detail[i].publish_module)
                            $("#reviewed_"+(args)+(test_id)+"_filename").html(detail[i].publish_filename)
                            if(args == 1){
                                $("#reviewed_"+(args)+(test_id)+"_status").html('<span class="badge badge-success">'+detail[i].publish_status+'</span>')
                            }else{
                                $("#reviewed_"+(args)+(test_id)+"_status").html('<span class="badge badge-danger">'+detail[i].publish_status+'</span>')
                            }
                            
                            $("#reviewed_"+(args)+(test_id)+"_createtime").html(detail[i].create_time)
                            $("#reviewed_"+(args)+(test_id)+"_serverlist").html(detail[i].publish_serverlist)
                            $("#reviewed_"+(args)+(test_id)+"_review_owner").html(detail[i].review_owner)
                            $("#reviewed_"+(args)+(test_id)+"_review_time").html(detail[i].review_time)
                            $("#reviewed_"+(args)+(test_id)+"_review_info").html(detail[i].review_info.substring(0,10)+"..."+"<a href='/softwaretest/TestReport/"+(test_id)+"/'><span class='badge badge-info'>查看详情</span></a>")
                            $("#reviewed_"+(args)+(test_id)+"_test_user").html(detail[i].test_user)
                            $("#reviewed_"+(args)+(test_id)+"_test_time").html(detail[i].test_endtime)
                    
                    }
                    // console.log(detail.length)
                    return detail.length;
                    // console.log(detail.length)

                    // $('#pageToolbar').html("");
                    // $('#pageToolbar').Paging({pagesize:10,count:val.page_total,callback:function(page,size,count){
                    //  //page:当前选择页码
                    //  //size:当前每页显示数量
                    //  //count：当前页码总数(含有多少个size)
                    //  console.log('当前页是第'+page+'页')
                    //  }
                    // });
                },error:function(){
                    console.log('error')
                }
            });
        };


        //取出总页数
        $.ajax({
            type:'POST',
            url:'/softwaretest/GetActionSearchListPageCount/',
            data:{'args':args,'k_words':k_words},
            dataType:'text',
            success:function(val){
                // args:
                // 1-success
                // 2-failed
                if(args == '1'){
                    $("#successcount").html(val)
                }else{
                    $("#failedcount").html(val)
                }
                GetAcceptSearchTestInfo(args,s_page,page_size);
                //加载页码
                $('#pageToolbar').html("");
                $('#pageToolbar').Paging({pagesize:10,count:val,callback:function(page,size,count){
                    //page:当前选择页码
                    //size:当前每页显示数量
                    //count：当前页码总数(含有多少个size)
                    GetAcceptSearchTestInfo(args,page,10)
                    }
                });
            },error:function(){
                console.log('error')
            }
        });

    };



    
</script>